package com.ruoyi.wechat.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.FacilityTypeMapper;
import com.ruoyi.wechat.domain.FacilityType;
import com.ruoyi.wechat.service.IFacilityTypeService;

/**
 * 服务设施类型Service业务层处理
 * 
 * @author 孙伟光
 * @date 2024-07-25
 */
@Service
public class FacilityTypeServiceImpl implements IFacilityTypeService 
{
    @Autowired
    private FacilityTypeMapper facilityTypeMapper;

    /**
     * 查询服务设施类型
     * 
     * @param ftId 服务设施类型主键
     * @return 服务设施类型
     */
    @Override
    public FacilityType selectFacilityTypeByFtId(String ftId)
    {
        return facilityTypeMapper.selectFacilityTypeByFtId(ftId);
    }

    /**
     * 查询服务设施类型列表
     * 
     * @param facilityType 服务设施类型
     * @return 服务设施类型
     */
    @Override
    public List<FacilityType> selectFacilityTypeList(FacilityType facilityType)
    {
        return facilityTypeMapper.selectFacilityTypeList(facilityType);
    }

    /**
     * 新增服务设施类型
     * 
     * @param facilityType 服务设施类型
     * @return 结果
     */
    @Override
    public int insertFacilityType(FacilityType facilityType)
    {
        //随机ID
        facilityType.setFtId(IdUtils.randomUUID());
        return facilityTypeMapper.insertFacilityType(facilityType);
    }

    /**
     * 修改服务设施类型
     * 
     * @param facilityType 服务设施类型
     * @return 结果
     */
    @Override
    public int updateFacilityType(FacilityType facilityType)
    {
        return facilityTypeMapper.updateFacilityType(facilityType);
    }

    /**
     * 批量删除服务设施类型
     * 
     * @param ftIds 需要删除的服务设施类型主键
     * @return 结果
     */
    @Override
    public int deleteFacilityTypeByFtIds(String[] ftIds)
    {
        return facilityTypeMapper.deleteFacilityTypeByFtIds(ftIds);
    }

    /**
     * 删除服务设施类型信息
     * 
     * @param ftId 服务设施类型主键
     * @return 结果
     */
    @Override
    public int deleteFacilityTypeByFtId(String ftId)
    {
        return facilityTypeMapper.deleteFacilityTypeByFtId(ftId);
    }
}
